Function Should-Process ($Message, [REF]$AllAnswer, $Warning = "", [Switch]$Verbose, [Switch]$Confirm, [Switch]$Whatif)
{
  function Skipping
  {
    Log-Message "Skipping operation - $Message"
  }
  
  function write-confirm
  {

    Log-Message "?????????????????????????????????????????????????????????????????????????????????????????????"
    Log-Message "Confirm"
    Log-Message "Are you sure you want to perform this action?"
    Log-Message "Performing operation " -noNewLine
    Log-Message "$Message" -backgroundColor White -foregroundcolor Black
    if ($Warning.length -gt 0)
    {
      Log-Message
      Log-Message "$Warning" -backgroundColor Black -foregroundcolor Yellow
      Log-Message
    }
  }
  
  ###############################################################################################
  # Check to see if "YES to All" or "NO to all" has previously been selected
  # Note that this technique requires the [REF] attribute on the variable.
  # Here is an example of how to use this:
  if ($AllAnswer.Value -eq $false)
  { 
    Skipping
    return $false
  }
  elseif ($AllAnswer.Value -eq $true)
  {  
    return $true
  }
  
  ###############################################################################################
  if ($Whatif)
  {  
    Log-Message "No Action Taken - $Message"
    return $false
  }
  
  ###############################################################################################
  if ($Confirm)
  {
    write-confirm
    while ($True)
    {
      $answer = Read-Host @"
[Y] Yes  [A] Yes to All  [N] No  [L] No to all  [S] Suspend  [?] Help (default is "Y")
"@
     switch ($Answer)
     { "Y"   { return $true}
       ""    { return $true}
       "A"   { $AllAnswer.Value = $true; return $true }
       "N"   { Skipping; return $false }
       "L"   { Skipping; $AllAnswer.Value = $false; return $false }
       "S"   { $host.EnterNestedPrompt(); write-confirm }
       "?"   { Log-Message @"
Y - Continue with only the next step of the operation.
A - Continue with all the steps of the operation.
N - Skip this operation and proceed with the next operation.
L - Skip this operation and all subsequent operations.
S - Pause the current pipeline and return to the command prompt. Type "exit" to resume the pipeline.
"@}
     }
   }
 }
 
 ###############################################################################################
 
 if ($verbose)
 {
   Write-Verbose "Performing - $Message."
 }

 ###############################################################################################

 return $true
}
